<template>
  <div>
    <div class="footer_wrap">
      <span @click="go('/find','find')">发现音乐</span>
      <span @click="go('/my','my')">我的音乐</span>
      <span @click="go('/part','part')">朋友</span>
    </div>
    <div class="top">
      
      <router-view />
    </div>
  </div>
</template>

<script>
export default {
  methods: {
    go(path,name) {
      this.$router.push({
        path,
        // name`
        query: {
          name:'马飞飞',
          age:18
        }

      // 使用params传参刷新会丢失参数
        //  this.$router.push({
        // name,
        // // name`
        // params: {
        //   name:'pdd',
        //   age:28
        // }
      })
    }
  }
};
</script>

<style scoped>
.footer_wrap {
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  width: 100%;
  text-align: center;
  background-color: #333;
  color: #ccc;
}
.footer_wrap a, span {
  flex: 1;
  text-decoration: none;
  padding: 20px 0;
  line-height: 20px;
  background-color: #333;
  color: #ccc;
  border: 1px solid black;
}
.footer_wrap a:hover, span:hover {
  background-color: #555;
}
.top {
  padding-top: 62px;
}
.router-link-active {
  background-color: red !important;
}
</style>